package com.mingqijia.gassafety.shared.constant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author li.shiying
 * @create 2023/09/21
 */
@Getter
@RequiredArgsConstructor
public enum OperateRecordEnum {

    OPERATE_TYPE_1(1,"customerInfo","编辑-客户基本信息","修改客户基本信息\n"),
    OPERATE_TYPE_2(2,"customerList","新增","新增"),
    OPERATE_TYPE_3(3,"customerList","删除","删除"),
    OPERATE_TYPE_4(4,"customerList","批量删除","删除"),
    OPERATE_TYPE_5(5,"customerInfo","新增-联系人信息","新增联系人信息\n"),
    OPERATE_TYPE_6(6,"customerInfo","修改-联系人信息","修改联系人信息\n"),
    OPERATE_TYPE_7(7,"customerInfo","删除-联系人信息","删除联系人信息\n"),
    OPERATE_TYPE_9(9,"customerInfo","关联设备","关联"),
    OPERATE_TYPE_10(10,"customerInfo","解除关联-报警器","解除关联"),
    OPERATE_TYPE_11(11,"customerInfo","编辑-安装位置","修改安装位置"),
    OPERATE_TYPE_12(12,"customerInfo","编辑-设备名称","修改设备名称"),
    OPERATE_TYPE_13(13,"customerInfo","新增-关联电磁阀",""),
    OPERATE_TYPE_14(14,"customerInfo","修改-关联电磁阀","修改关联电磁阀\n"),
    OPERATE_TYPE_15(15,"customerInfo","解除关联-电磁阀" ,"解除关联电磁阀\n"),
    OPERATE_TYPE_16(16,"dtuManager","新增","新增"),
    OPERATE_TYPE_17(17,"dtuManager","导入","导入设备"),
    OPERATE_TYPE_18(18,"dtuManager","编辑","修改信息"),
    OPERATE_TYPE_19(19,"dtuManager","删除","删除\n"),
    OPERATE_TYPE_20(20,"dtuManager","批量删除","删除\n"),
    OPERATE_TYPE_21(21,"fieldTemplate","修改","修改"),
    OPERATE_TYPE_23(23,"warnStrategy","新增","新增"),
    OPERATE_TYPE_24(24,"warnStrategy","编辑","编辑"),
    OPERATE_TYPE_25(25,"warnStrategy","启用","启用"),
    OPERATE_TYPE_41(41,"warnStrategy","禁用","禁用"),
    OPERATE_TYPE_42(42,"warnStrategy","批量启用","启用"),
    OPERATE_TYPE_43(43,"warnStrategy","批量禁用","禁用"),
    OPERATE_TYPE_26(26,"warnStrategy","删除","删除"),
    OPERATE_TYPE_27(27,"businessNotice","新增","新增"),
    OPERATE_TYPE_28(28,"businessNotice","编辑","修改"),
    OPERATE_TYPE_29(29,"businessNotice","删除","删除"),
    OPERATE_TYPE_57(57,"businessNotice","开启","开启"),
    OPERATE_TYPE_58(58,"businessNotice","关闭","关闭"),
    OPERATE_TYPE_59(59,"businessNotice","参数值配置","配置"),
    OPERATE_TYPE_30(30,"valveInfo","新增","新增"),
    OPERATE_TYPE_31(31,"valveInfo","编辑","修改"),
    OPERATE_TYPE_32(32,"valveInfo","删除","删除"),
    OPERATE_TYPE_33(33,"warningRecord","暂停","暂停"),
    OPERATE_TYPE_34(34,"dictionariesInfo","新增","新增"),
    OPERATE_TYPE_35(35,"dictionariesInfo","编辑","编辑"),
    OPERATE_TYPE_36(36,"dictionariesInfo","删除","删除"),
    OPERATE_TYPE_37(37,"dictionariesInfo","批量删除","批量删除"),
    OPERATE_TYPE_38(38,"customerList","导入","导入客户"),
    OPERATE_TYPE_39(39,"customerList","批量安装导入","导入客户"),
    OPERATE_TYPE_40(40,"customerList","安装诉求","安装诉求"),
    OPERATE_TYPE_44(44,"dictionaries","新增","新增"),
    OPERATE_TYPE_45(45,"dictionaries","编辑","编辑"),
    OPERATE_TYPE_46(46,"dictionaries","删除","删除"),
    OPERATE_TYPE_47(47,"dictionaries","同步数据字典","同步数据字典"),
    OPERATE_TYPE_48(48,"runningStrategy","新增","新增"),
    OPERATE_TYPE_49(49,"runningStrategy","编辑","编辑"),
    OPERATE_TYPE_50(50,"runningStrategy","禁用","禁用"),
    OPERATE_TYPE_51(51,"runningStrategy","启用","启用"),
    OPERATE_TYPE_52(52,"runningStrategy","批量禁用","禁用"),
    OPERATE_TYPE_53(53,"runningStrategy","批量启用","启用"),
    OPERATE_TYPE_54(54,"runningStrategy","删除","删除"),
    OPERATE_TYPE_55(55,"customerInfo","编辑-安装日期","修改安装日期"),
    OPERATE_TYPE_56(56,"surveyList","状态调整","修改设备状态"),
    OPERATE_TYPE_60(60,"customerInfo","编辑-服务信息" ,"编辑服务信息\n"),
    OPERATE_TYPE_61(61,"runningReportConfig","设备运行报告生成配置" ,""),
    OPERATE_TYPE_62(62,"runningReportConfig","设备运行报告文档模版" ,""),
    OPERATE_TYPE_63(63,"runningReport","更新数据" ,"更新数据"),
    OPERATE_TYPE_64(64,"runningReport","审核" ,"审核"),
    OPERATE_TYPE_65(65,"runningReport","下载" ,"下载"),
    OPERATE_TYPE_66(66,"runningReport","一键全部审核" ,"一键全部审核"),
    OPERATE_TYPE_67(67,"runningReport","批量审核" ,"批量审核"),
    OPERATE_TYPE_68(68,"runningReport","全部数据更新" ,"全部数据更新"),
    OPERATE_TYPE_69(69,"runningReport","批量数据更新" ,"批量数据更新"),
    OPERATE_TYPE_70(70,"runningReport","重新生成报告" ,"重新生成报告"),
    OPERATE_TYPE_71(71,"runningReport","批量下载" ,"批量下载"),
    OPERATE_TYPE_72(72,"runningReport","全部下载" ,"全部下载"),
    OPERATE_TYPE_73(73,"funcarea","新增" ,"新增功能区域"),
    OPERATE_TYPE_74(74,"funcarea","编辑" ,"修改功能区域"),
    OPERATE_TYPE_75(75,"funcarea","删除" ,"删除功能区域"),
    OPERATE_TYPE_76(76,"servicePkgRecord","新增" ,"新增服务套餐记录"),
    OPERATE_TYPE_77(77,"servicePkgRecord","编辑" ,"修改服务套餐记录"),
    OPERATE_TYPE_78(78,"servicePkgRecord","删除" ,"删除服务套餐记录"),
    OPERATE_TYPE_79(79,"runningReport","C端预览" ,""),
    OPERATE_TYPE_80(80,"dtuManager","导入","导入删除设备"),
    OPERATE_TYPE_81(81,"customerInfo","更新-燃气户信息","更新-燃气户信息\n"),
    ;




    private final Integer code;
    private final String menu;
    private final String operationType;
    private final String operateInfo;

    public static OperateRecordEnum getInfo (Integer code){
        OperateRecordEnum[] values = OperateRecordEnum.values();

        if (code == null){
            return null;
        }
        for (OperateRecordEnum typeEnum : values) {
            if (typeEnum.code.equals(code)) {
                return typeEnum;
            }
        }

        return null;
    }

    public static List<OperateRecordEnum> getList (String menu){
        List<OperateRecordEnum> list = new ArrayList<>();
        OperateRecordEnum[] values = OperateRecordEnum.values();
        for (OperateRecordEnum typeEnum : values) {
            if (typeEnum.menu.equals(menu)) {
                list.add(typeEnum);
            }
        }
        return list;
    }
}
